package com.zfei.gfb.request;

import com.zfei.gfb.bean.Const;
import com.zfei.gfb.bean.Status;
import com.zfei.gfb.bean.StatusException;
import com.zfei.gfb.util.ObjUtil;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;


/**
 * @author fgh
 */
public class GfbNoticeEditRequest {

    // id
    @ApiModelProperty(value = "通知id", required = true)
    private Integer id;
    // 内容
    @ApiModelProperty(value = "内容", required = true)
    private String content;

    public void setId(Integer value) {
        this.id = value;
    }

    public Integer getId() {
        return this.id;
    }

    public void setContent(String value) {
        this.content = value;
    }

    public String getContent() {
        return this.content;
    }

    public void checkUpdateNull() {
        if (ObjUtil.anyNull(id, content)) {
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
        if(StringUtils.isBlank(content)){
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
        if(content.length() > Const.CONTENT_LENGTH){
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
    }
}

